import {reqNavList} from '@/api'
const actions = {
  async getNavList({commit}){
    const res = await reqNavList()
    if(res.code == 200){
      commit("GETNAVLIST",res.data)
    }
  }
}

const mutations = {
  COLLAPSE(state){
    state.isCollapse = !state.isCollapse
  },
  GETNAVLIST(state,data){
    state.navList = data
  }
}

const state = {
  // 左侧导航的塌陷情况：false为展开，ture为塌陷
  isCollapse:false,
  navList:[]
}

const getters = {

}

export default {
  namespaced:true,
  state,
  actions,
  mutations,
  getters
}